package com.excel.constant;

/**
 * @ClassName RedisConstant
 **/
public class RedisConstant {

    private RedisConstant() {

    }

    public static final long AVTAR_EXPIRE = 86400L;

    public static final long AGENT_EXPIRE = 86400L;

    private static final String REDIS_PREFIX = "multi-dim-eval:";

    public static final String REDIS_NUMBER_PREFIX = "multi-number-gen:";

    public static final String QUESTION_BANK_CODE_KEY = "questionBank:code:question_code_key";

    public static final String SUBJECT_CODE_KEY = "questionBank:code:subject_code_key";

    public static final String QUESTIONNAIRE_CODE_KEY = "questionnaire:code:questionnaire_code_key";

    public static final String QUESTIONNAIRE_CODE_LOCK_KEY = "questionnaire:code:questionnaire_code_lock_key";

    public static final String SUBJECT_CODE_LOCK_KEY = "subject:code:subject_code_lock_key";

    public static final String PROJECT_CODE_KEY = "project:code:project_code_key";

    public static final String DIMENSION_DESCRIBE_KEY = "dimension:describe:code_key";

    public static final String EVAL_TASK_USER_RESULT_KEY = "evalTaskId:%s:user:%s:result";

    public static String getAvatarKey(String userId) {
        return REDIS_PREFIX + "avatar:" + userId;
    }

    public static String getImportInfoIdKey(Integer importInfoId) {
        return REDIS_PREFIX + "importInfo:" + importInfoId;
    }

    public static String getEvalObjRecommendIdKey(Integer evalObjId) {
        return REDIS_PREFIX + "project:" + "recommendInfo:" + evalObjId;
    }

    public static String getEvalObjReportIdKey(Integer evalObjId) {
        return REDIS_PREFIX + "project:" + "report:" + evalObjId;
    }

    public static String getAddOrDelEvalRelationKey(Integer evalObjId) {
        return REDIS_PREFIX + "addOrDelEvalRelationKey:" + evalObjId;
    }

    public static String getSaveEvaluatorKey(Integer projectId, String evaluatorEmpId) {
        return REDIS_PREFIX + "saveEvaluator:" + projectId + ":" + evaluatorEmpId;
    }

    /**
     * 获取用户代理缓存key
     *
     * @param userId
     * @return
     */
    public static String getUserAgentKey(String userId) {
        return REDIS_PREFIX + "userAgent:" + userId;
    }


    public static final String EVAL_OBJ_ADD_CODE_KEY = "EVAL_OBJ_ADD_CODE_KEY:";

    public static final String DIMENSION_DATE_CACHE_KEY = "DIMENSION_DATE_CACHE_KEY";

    public static String getQuestionnaireCodeKey() {
        return REDIS_NUMBER_PREFIX + QUESTIONNAIRE_CODE_LOCK_KEY;
    }

    public static String getSubjectCodeKey() {
        return REDIS_NUMBER_PREFIX + SUBJECT_CODE_LOCK_KEY;
    }


    public static String getSubmitEvalTaskKey(Integer evalTaskId, String evaluatorUserId) {
        return REDIS_NUMBER_PREFIX + "evalTaskId:" + evalTaskId + ":evaluatorUserId:" + evaluatorUserId;
    }
}